/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.zhangyj.applets.data;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
import java.util.List;
import java.util.Vector;
import javax.swing.tree.TreeNode;

/**
 *
 * @author zhangyj
 */
public class BoastTreeNode implements javax.swing.tree.TreeNode{
    Vector<BoastTreeNode> children = new Vector<BoastTreeNode>();
    BoastTreeNode parentNode;
    boolean leaf = false;
    @Override
    public Enumeration children() {
       return children.elements();
    }

    @Override
    public boolean getAllowsChildren() {
        return !this.isLeaf();
    }

    @Override
    public BoastTreeNode getChildAt(int childIndex) {
        return children.get(childIndex);
    }

    @Override
    public int getChildCount() {
        return children.size();
    }

    @Override
    public int getIndex(TreeNode node) {
        return children.indexOf(node);
    }

    @Override
    public BoastTreeNode getParent() {
        return parentNode;
    }

    @Override
    public boolean isLeaf() {
       return leaf;
    }
    
}
